<?php

if(!empty($_POST))
{
//	print_r($_POST);
//	die;
	$_POST['permission_id']=json_encode($_POST['permission_id']);
	$re = insert('permission', $_POST);
	if($re)
	{
		echo '添加成功';
		header('Refresh:1;index.php?a=admin&b=permission&c=index');
		die;
	}
	else
	{
		echo '添加失败';
		header('Refresh:1;index.php?a=admin&b=permission&c=add');
		die;
	}	
}

	$role = selectAll('permission');
	$permission = selectAll('menu');

include('app/admin/permission/html/add.html');
?>